@section head{
    <link href="~/theme/default/syssetting/logevent.index.css" rel="stylesheet" asp-append-version="true"/>
}
<div class="zb-flex-1 zb-flex zb-flex-column zb-w">
    <div class="zb-query-frame">

        <div class="query-block">
            <span>事件id：</span>
            <el-input placeholder="请输入事件id"
                      v-model="query.eventId"
                      size="mini">
            </el-input>
        </div>

        <div class="query-block">
            <span>消息：</span>
            <el-input placeholder="请输入消息"
                      v-model="query.message"
                      size="mini">
            </el-input>
        </div>

        <div class="query-block">
            <el-button type="primary"
                       icon="el-icon-search"
                       @@click="onQuery"
                       v-if="buttons.hasQuery"
                       size="mini">查询</el-button>
            <el-button type="success"
                       icon="el-icon-s-promotion"
                       @@click="onExport"
                       v-if="buttons.hasExport"
                       size="mini">导出</el-button>
        </div>
    </div>
    <el-table :data="tableData.records"
              height="250"
              border
              class="zb-border-no"
              ref="tblRecords"
              style="width: 100%"
              size="mini">
        <el-table-column type="index"
                         width="50"
                         align="center"
                         title="序号"
                         :index="recordIndex"
                         fixed="left">
        </el-table-column>

        <el-table-column prop="eventId"
                         label="事件id"
                         width="80"
                         align="center">
        </el-table-column>

        <el-table-column prop="levels"
                         label="级别"
                         width="70"
                         align="center">
        </el-table-column>

        <el-table-column prop="operatingTime"
                         label="操作时间"
                         width="150"
                         align="center">
            <template slot-scope="scope">
                <span v-text="scope.row.operatingTime.replace('T', ' ')"></span>
            </template>
        </el-table-column>

        <el-table-column prop="operatingaddress"
                         label="IP地址"
                         width="120"
                         align="center">
        </el-table-column>

        <el-table-column prop="userid"
                         label="用户"
                         width="90"
                         align="center">
        </el-table-column>

        <el-table-column prop="message"
                         label="消息">
        </el-table-column>

        <el-table-column label="详细信息"
                         fixed="right"
                         width="90"
                         align="center">
            <template slot-scope="scope">
                <el-button type="success"
                           icon="el-icon-tickets"
                           @@click="onDetails(scope.row)"
                           circle
                           size="mini"></el-button>
            </template>
        </el-table-column>
    </el-table>
    <el-pagination background
                   layout="prev, pager, next, jumper, total"
                   :page-size="query.pageSize"
                   :total="tableData.total"
                   @@current-change="onPageChange">
    </el-pagination>
    <el-drawer title="日志详细信息"
               :visible.sync="detailsInfo.visible"
               direction="rtl">
        <div class="zb-form-item">
            <label class="item-label">日志ID</label>
            <div class="item-content" v-text="detailsInfo.data.pkid"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">事件ID</label>
            <div class="item-content" v-text="detailsInfo.data.eventId"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">级别</label>
            <div class="item-content" v-text="detailsInfo.data.levels"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">操作时间</label>
            <div class="item-content" v-text="detailsInfo.data.operatingTime && detailsInfo.data.operatingTime.replace('T',' ')"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">操作IP</label>
            <div class="item-content" v-text="detailsInfo.data.operatingaddress"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">操作人员</label>
            <div class="item-content" v-text="detailsInfo.data.userid"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">用户</label>
            <div class="item-content" v-text="detailsInfo.data.logger"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">调用站点</label>
            <div class="item-content" v-text="detailsInfo.data.callSite"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">请求Url</label>
            <div class="item-content" v-text="detailsInfo.data.requesturl"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">跳转Url</label>
            <div class="item-content" v-text="detailsInfo.data.referrerurl"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">action</label>
            <div class="item-content" v-text="detailsInfo.data.action"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">日志内容</label>
            <div class="item-content" v-text="detailsInfo.data.message"></div>
        </div>
        <div class="zb-form-item">
            <label class="item-label">异常追踪</label>
            <div class="item-content" v-text="detailsInfo.data.exception"></div>
        </div>
    </el-drawer>
</div>
@section script{
    <script src="~/module/common/form.template.js" type="text/babel"></script>
    <script src="~/module/baseinfo/logevent.index.js" asp-append-version="true" type="text/babel"></script>
}
